package com.bdqn.controller;

import com.bdqn.service.AsyncService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <Description> <br>
 *
 * @author tao<br>
 * @version 1.0<br>
 * @taskId: <br>
 * @createDate 2019/10/08 11:31 <br>
 * @see com.bdqn.controller <br>
 */
@RestController
public class AsyncController {
    private static final Logger log = LoggerFactory.getLogger(AsyncController.class);

    @Autowired
    private AsyncService asyncService;

    @RequestMapping("/commMethod")
    public String commMethod() {
        log.info("-----------------commMethod--------------------");
        log.info("1");
        String result = asyncService.commMethod();
        log.info("4");

        return result;
    }

    @RequestMapping("/asyncMethod")
    public String asyncMethod() {
        log.info("-----------------asyncMethod--------------------");
        log.info("1");
        String result = asyncService.asyncMethod();
        log.info("4");

        return result;
    }

}
